﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using qiupeng.Public;
using System.IO;

public partial class SystemManage_SysData_add : Base
{
    Db List = new Db();
    public static string type, typename;
    protected void Page_Load(object sender, EventArgs e)
    {
       

        if (!Page.IsPostBack)
        {
            type = base.Request.QueryString["type"].ToString();
            if (type == "1")
            {
                typename = "学历";
            }
            if (type == "2")
            {
                typename = "事故类型";
            }
            if (type == "3")
            {
                typename = "执业资格";
            }
            if (type == "4")
            {
                typename = "工资项目";
            }
            if (type == "5")
            {
                typename = "班次类型";
            }
            if (type == "6")
            {
                typename = "休假类型";
            }
            if (type == "7")
            {
                typename = "伤害部位";
            }
            if (type == "8")
            {
                typename = "婚姻状况";
            }
            if (type == "9")
            {
                typename = "健康状况";
            }
            if (type == "10")
            {
                typename = "伤害程度";
            }
            if (type == "11")
            {
                typename = "协议类型";
            }
            if (type == "12")
            {
                typename = "在职状态";
            }
            if (type == "13")
            {
                typename = "事故级别";
            }
            if (type == "14")
            {
                typename = "课件类别";
            }
            if (type == "15")
            {
                typename = "非伤亡事故类别";
            }
            if (type == "16")
            {
                typename = "人才等级";
            }
            if (type == "17")
            {
                typename = "培训类型";
            }
            if (type == "18")
            {
                typename = "流程操作";
            }
            if (type == "19")
            {
                typename = "招聘来源";
            }
            if (type == "20")
            {
                typename = "面试方式";
            }
            if (type == "21")
            {
                typename = "行业性质";
            }
            if (type == "22")
            {
                typename = "企业性质";
            }
            if (type == "23")
            {
                typename = "合同变更";
            }
            if (type == "24")
            {
                typename = "奖励项目";
            }
            if (type == "25")
            {
                typename = "处分项目";
            }
            if (type == "26")
            {
                typename = "离职原因";
            }
            if (type == "27")
            {
                typename = "人才分类";
            }
            if (type == "28")
            {
                typename = "管理级别";
            }
            if (type == "29")
            {
                typename = "籍贯";
            }
            if (type == "30")
            {
                typename = "初选方式";
            }
            if (type == "31")
            {
                typename = "培训计划年份";
            }
            if (type == "32")
            {
                typename = "培训方式";
            }
            if (type == "33")
            {
                typename = "课件类别";
            }
            if (type == "34")
            {
                typename = "授课方式";
            }
            if (type == "35")
            {
                typename = "培训方法";
            }
            if (type == "36")
            {
                typename = "协议类型";
            }
            if (type == "37")
            {
                typename = "培训协议年份";
            }
            if (type == "38")
            {
                typename = "事故类别";
            }
            if (type == "39")
            {
                typename = "合同类型";
            }
            if (type == "40")
            {
                typename = "合同解除类别";
            }
            if (type == "41")
            {
                typename = "合同恢复类别";
            }
            if (type == "42")
            {
                typename = "合同试用类别";
            }
            if (type == "43")
            {
                typename = "合同转正类别";
            }
            if (type == "44")
            {
                typename = "合同变更类别";
            }
            if (type == "45")
            {
                typename = "合同续签类别";
            }
            if (type == "46")
            {
                typename = "三违种类";
            }
            if (type == "47")
            {
                typename = "初选工种";
            }
            if (type == "48")
            {
                typename = "调动类型";
            }
            if (type == "49")
            {
                typename = "离职类型";
            }
            if (type == "50")
            {
                typename = "复职类型";
            }
            if (type == "51")
            {
                typename = "证照类型";
            }
            if (type == "52")
            {
                typename = "发证机构";
            }
            if (type == "53")
            {
                typename = "职称取得方式";
            }
            if (type == "54")
            {
                typename = "考核类型";
            }
            if (type == "55")
            {
                typename = "考核期间";
            }
            if (type == "56")
            {
                typename = "开户行";
            }
            if (type == "57")
            {
                typename = "职务类别";
            }
            if (type == "98")
            {
                typename = "政治面貌";
            }
            if (type == "97")
            {
                typename = "员工岗位";
            }
            if (type == "96")
            {
                typename = "员工职务";
            }
            if (type == "95")
            {
                typename = "员工职称";
            }
            if (type == "94")
            {
                typename = "惩罚类别";
            }
            this.BindAttribute();

        }



    }
    public void BindAttribute()
    {
        Button2.Attributes["onclick"] = "javascript:return showwait();";
        Button1.Attributes["onclick"] = "javascript:return chknull();";
    }


    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("SysData.aspx?type=" + type + "");
    }

    protected void Button1_Click(object sender, EventArgs e)
    {


        string sql_insert = "insert into qp_hr_SysData (Name,Type) "
                          + "values ('" + List.GetFormatStr(Name.Text) + "','" + Request.QueryString["type"].ToString() + "')";
        List.ExeSql(sql_insert);

        List.InsertLog("新增基础数据[" + List.GetFormatStr(Name.Text) + "]", "系统管理-基础数据-" + typename + "");


        this.Response.Write("<script language=javascript>alert('提交成功！');window.location.href='SysData.aspx?type=" + Request.QueryString["type"].ToString() + "'</script>");


    }
}
